import type { PropType } from 'vue'
import { BasicColumn } from './types/table'

export const basicProps = {
    title: {
        type: String,
        default: null,
    },
    titleTooltip: {
        type: String,
        default: null,
    },
    size: {
        type: String,
        default: 'medium',
    },
    tableData: {
        type: [Object],
        default: () => {
        },
    },
    columns: {
        type: [Array] as PropType<BasicColumn[]>,
        default: () => [],
        required: true,
    },
    request: {
        type: Function as PropType<(...arg: any[]) => Promise<any>>,
        default: null,
        required: true
    },
    rowKey: {
        type: [String, Function] as PropType<string | ((record) => string)>,
        default: undefined,
    },
    pagination: {
        type: [Object, Boolean],
        default: () => {
        }
    },
    showPagination: {
        type: [String, Boolean],
        default: 'auto'
    },
    actionColumn: {
        type: Object as PropType<BasicColumn>,
        default: null,
    },
}
